package com.wxlsoft.excel.convert.listeners;

import javax.swing.JProgressBar;

import com.alibaba.excel.context.AnalysisContext;
import com.wxlsoft.excel.convert.model.ModifyHistory;
import com.wxlsoft.excel.convert.model.SheetDataConvertCollector;
import com.wxlsoft.excel.core.AbstractSheetListener;

import lombok.NonNull;

/**
 * Modify 监听页
 * @author wangxiaoliang
 */
public class ModifyHistoryListener extends AbstractSheetListener<ModifyHistory> {

	private final SheetDataConvertCollector collector;
	
	public ModifyHistoryListener(String sheetName, JProgressBar progress,
			@NonNull final SheetDataConvertCollector collector) {
		super(sheetName, progress);
		this.collector = collector;
	}
	
	@Override
    public void invoke(ModifyHistory data, AnalysisContext context) {
		collector.addHistory(data);
    }

    @Override
    public void doAfter(AnalysisContext context) {}

}
